using System;
//UPGRADE_TODO: The type 'StarBotDotNet.Constants.Order' could not be found. If it was not included in the conversion, there may be compiler issues. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1262'"
using Order = StarBotDotNet.Constants.Order;
using System.Collections.Generic;
using StarBotDotNet;
namespace StarBotDotNet
{
	/// <summary> Throw in your bot code here.</summary>
    public class StarCraftAgent : IAgent
	{
        UnitManager units = new UnitManager();
        public StarCraftAgent()
        {
        }
		
		public virtual void  start()
		{
			
			ProxyBot bot = ProxyBot.Proxy;
			CurrentPlayer.PlayerID = bot.PlayerID;
            units.AddParty(new MiningParty(bot));
            units.AddParty(new BuildingParty(bot));

            //units.AddParty(new MiningParty(bot));
            //units.AddParty(new BuildingParty(bot));

            //units.AddParty(new MiningParty(bot));
            //units.AddParty(new BuildingParty(bot));

            //units.AddParty(new MiningParty(bot));
            //units.AddParty(new BuildingParty(bot));

            int currentTime = 0;
			while (true)
			{
                

				try
				{
					//UPGRADE_TODO: Method 'java.lang.Thread.sleep' was converted to 'System.Threading.Thread.Sleep' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangThreadsleep_long'"
					System.Threading.Thread.Sleep(1000);
				}
				catch (System.Exception)
				{
				}

                currentTime += 1000;
                units.RunUnitManager(bot.Units, currentTime, bot);
			}
		}


	}
}